package com.ace3l.legal.gwt.domainmodule.domainxform;

import com.ace3l.legal.backend.domain.LawFirm;
import com.ace3l.legal.backend.domain.User;
import com.ace3l.legal.gwt.domainmodule.gwt.GWTLawFirm;
import com.ace3l.legal.gwt.domainmodule.gwt.GWTUser;

import java.util.List;

/**
 * Created by IntelliJ IDEA.
 * User: ageer
 * Date: Jul 22, 2008
 * Time: 11:28:58 AM
 * To change this template use File | Settings | File Templates.
 */
public class LawFirmXForm {
    public static LawFirm fromGWT(GWTLawFirm in) {
        if (in == null) return null;
        LawFirm out = new LawFirm();
        out.setContactFirstName(in.getContactFirstName());
        out.setContactLastName(in.getContactLastName());
        out.setContactPhone(in.getContactPhone());
        out.setEmail(in.getEmail());
        out.setEmailVerified(in.getEmailVerified());
        out.setFirmAddress1(in.getFirmAddress1());
        out.setFirmAddress2(in.getFirmAddress2());
        out.setFirmCity(in.getFirmCity());
        out.setFirmState(in.getFirmState());
        out.setFirmZip(in.getFirmZip());
        out.setLawFirmName(in.getLawFirmName());
        out.setLawFirmStatus(in.getLawFirmStatus());

        User myUser = UserXForm.fromGWT(in.getUser());
        out.setUser(myUser);
        return out;

    }

    public static GWTLawFirm toGWT(LawFirm in) {
        if (in == null) return null;
        GWTLawFirm out = new GWTLawFirm();
        out.setContactFirstName(in.getContactFirstName());
        out.setContactLastName(in.getContactLastName());
        out.setContactPhone(in.getContactPhone());
        out.setEmail(in.getEmail());
        out.setEmailVerified(in.getEmailVerified());
        out.setFirmAddress1(in.getFirmAddress1());
        out.setFirmAddress2(in.getFirmAddress2());
        out.setFirmCity(in.getFirmCity());
        out.setFirmState(in.getFirmState());
        out.setFirmZip(in.getFirmZip());
        out.setLawFirmName(in.getLawFirmName());
        out.setLawFirmStatus(in.getLawFirmStatus());

        GWTUser myUser = UserXForm.toGWT(in.getUser());
        out.setUser(myUser);
        return out;

    }

   
}
